import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { resolve } from "path";
import dts from "vite-plugin-dts";
import { visualizer } from "rollup-plugin-visualizer";
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    svelte(),
    dts({
      insertTypesEntry: true,
    }),
    // visualizer({
    //   emitFile: true,

    // })
  ],
  server: {
    proxy: {
      "/api": {
        target: "https://test-ymsl.kxgcc.com:30195",
        changeOrigin: true,
      },
      "/public": {
        target: "https://test-ymsl.kxgcc.com:30195",
        changeOrigin: true,
      },
    },
  },
  build: {
    lib: {
      entry: resolve(__dirname, "src/main.ts"),
      name: "HelpWebModule",
      fileName: "index",
    },
  },
});
